CFLAG = -Wall -pedantic -O3

EXECUTABLES := bw bw2

COMMONMAKE := ./GPU.mk
include $(COMMONMAKE)

default: $(EXECUTABLES)

microtime.o: microtime.h microtime.c
	g++ $(CFLAG) -c microtime.c -o microtime.o

bw.cu_o: bw.cu $(COMMONMAKE) microtime.h bwt.h
	$(NVCC) $(NVCCFLAGS) $(INCLUDES) -o bw.cu_o -c bw.cu
	
bw: bw.cu_o microtime.o $(COMMONMAKE)
	$(LINK) -o bw bw.cu_o microtime.o $(LIBS)

bw2.cu_o: bw2.cu $(COMMONMAKE) microtime.h bwt.h
	$(NVCC) $(NVCCFLAGS) $(INCLUDES) -o bw2.cu_o -c bw2.cu
	
bw2: bw2.cu_o microtime.o $(COMMONMAKE)
	$(LINK) -o bw2 bw2.cu_o microtime.o $(LIBS)

clean:
	rm -f *.o *_o *~ core $(EXECUTABLES)

